package com.qf.ks.mapper;

import com.qf.ks.pojo.Books;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BookMapper {
    @Insert("insert into books(bookname,categoryid,authorid, bookdescription,bookpicurl) VALUES (#{bookname},#{categoryid},#{authorid},#{bookdescription},#{bookpicurl});")
    void AddBooks(Books books);
    @Select("select bookid,bookname,categoryid,authorid,bookpicurl,bookdescription from books where bookname like Concat('%',#{bookname},'%')")
    List<Books> findAllBooks(@Param("bookname") String bookname);
}
